﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ImagesByTags.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.ImagesByTags" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .tagNameTitle
        {
            text-align: center;
        }
        .style2
        {
            text-align: left;
            font-size: x-large;
            text-decoration: underline;
        }
        .style3
        {
            color: #3399FF;
        }
        .ImageLists
        {}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class = "style2">
    <strong>Images By <span class="style3"><em>Tag</em></span> Name </strong>
</div>
<br />
<div class = "ImagesByTagsInfo">


    <asp:Label ID="lblInfo" runat="server" Text="Label"></asp:Label>


</div>
<br />
<div class = "ImageLists">

    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
        GroupItemCount="3">
        <AlternatingItemTemplate>
            <td runat="server" style="">
            <a href="imageComments.aspx?id=<%# Eval("ImageIDFK") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                
                <br /><strong>Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Eval("ImageDescription") %>' />
                <br /><strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br /><strong>Time Uploaded:</Strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td runat="server" style="">
                 <a href="imageComments.aspx?id=<%# Eval("ImageIDFK") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                <br /><strong>Description:</strong>
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br /><strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br /><strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" style="">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
<td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td runat="server" style="">
                 <a href="imageComments.aspx?id=<%# Eval("ImageIDFK") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                <br /><strong>Description:</strong>
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br /><strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br /><strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td runat="server" style="">
                 <a href="imageComments.aspx?id=<%# Eval("ImageIDFK") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                
                <br /><strong>Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Eval("ImageDescription") %>' />
                <br /><strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br /><strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" border="0" style="">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" style="">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" style="">
                 <a href="imageComments.aspx?id=<%# Eval("ImageIDFK") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                <br /><strong>Image Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Eval("ImageDescription") %>' />
                <br /><strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br /><strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT Image_Tags.ImageIDFK, Tags.TagName, Images.ImageLink, Images.ImageDescription, Images.DateUploaded, Images.TimeUploaded FROM ((Image_Tags INNER JOIN Tags ON Image_Tags.TagIDFK = Tags.TagID) INNER JOIN Images ON Image_Tags.ImageIDFK = Images.ImageID) WHERE (Tags.TagName = ?) ORDER BY Image_Tags.ImageIDFK DESC">
        <SelectParameters>
            <asp:QueryStringParameter Name="?" QueryStringField="TagName" />
        </SelectParameters>
    </asp:SqlDataSource>

</div>
</asp:Content>
